import { defineStore } from "pinia";
import { DinosaurListItem, MyKTBalance } from '@/types/statistics'

export const useMainStore = defineStore({
    id: "main",
    state: (): {
        pageStack: string[];
        BarHeight: number;
        currentChainId: number;
        dinosaurListMap: Record<number, DinosaurListItem>,
        ktBalance: MyKTBalance,
        configData: {
            tokenAddress: string;
            contractAddress: string;
            chainId: string;
            timeOut: string;
        }
    } => {
        return {
            pageStack: [""],
            BarHeight: 10,
            currentChainId: 97,
            dinosaurListMap: {},
            ktBalance: {
                ktBalance: 0,
                withdrawAmount: 0,
                totalAcquireAmount: 0,
                incentiveAmount: 0,
                issueAmount: 0,
                holdType: 1,
            },
            configData: {
                tokenAddress: '',
                contractAddress: '',
                chainId: '',
                timeOut: '0',
            }
        }
    },
    actions: {
        numAdd() {

        },
        addpageStack() {
            this.pageStack.push("");
        },
        removepageStack() {
            this.pageStack.pop();
        },
    }
})